export const formComponentConfig = {
  inputModal: () => import('@/common/components/search-modal/input-modal.vue'),
  categoryName: () =>
    import('@/common/components/search-modal/categoryName.vue'),
};
// 当前页面要渲染的查询条件
// 主表查询条件
export const formRenderKeys = ['categoryLv3Id', 'materialCode', 'materialName'];
// 按物料添加查询条件
export const formRenderKeysByMaterial = ['materialCode', 'materialName'];
// 按物料品类查询
export const formRenderKeysByCategoryName = ['categoryName'];
// 按品类添加查询条件
export const formRenderKeysByCategory = ['categoryCode', 'categoryName'];
// 按供应商添加查询条件
export const formRenderKeysBySupplier = [
  'supplierCode',
  'supplierChinese',
  'isGroup',
  'supplierQualified',
];
// 查询条件
export const formRenderConfig = {
  userName: {
    label: '用户名称',
    field: 'userName',
    width: '400px',
    componentName: 'input',
    componentProps: {
      placeholder: '请输入用户名称',
    },
  },
  categoryLv3Id: {
    label: '品类',
    field: 'categoryLv3Id',
    width: '400px',
    componentName: 'categoryName',
    componentProps: {
      title: '品类名称',
      type: 'categoryName',
      labelName: 'categoryName',
      valueName: 'id',
    },
  },
  materialCode: {
    label: '物料编码',
    field: 'materialCode',
    width: '400px',
    componentName: 'inputModal',
    componentProps: {
      title: '请选择物料编码',
      type: 'materialCode',
      labelName: 'materialCode',
      valueName: 'materialCode',
    },
  },
  materialName: {
    label: '物料名称',
    field: 'materialName',
    width: '400px',
    componentName: 'input',
    componentProps: {
      placeholder: '请输入物料名称',
    },
  },
  categoryName: {
    label: '品类名称',
    field: 'categoryName',
    width: '100px',
    componentName: 'input',
    componentProps: {
      placeholder: '请输入品类名称',
    },
  },
  categoryCode: {
    label: '品类编码',
    field: 'categoryCode',
    width: '200px',
    componentName: 'input',
    componentProps: {
      placeholder: '请输入品类编码',
    },
  },
  supplierCode: {
    label: '供应商编码',
    field: 'supplierCode',
    componentName: 'input',
    componentProps: {
      placeholder: '请输入供应商编码',
    },
  },
  supplierChinese: {
    label: '供应商名称',
    field: 'supplierChinese',
    componentName: 'input',
    componentProps: {
      placeholder: '请输入供应商名称',
    },
  },
  isGroup: {
    label: '是否集团内',
    field: 'isGroup',
    componentName: 'dictSelect',
    componentProps: {
      dictType: 'whether',
      allowClear: true,
      placeholder: '请选择是否在集团内',
    },
  },
  supplierQualified: {
    label: '合格供应商',
    field: 'supplierQualified',
    componentName: 'dictSelect',
    componentProps: {
      dictType: 'whether',
      allowClear: true,
      placeholder: '请选择合格供应商',
    },
  },
};
